package com.mmall.util;

import com.google.common.base.Splitter;
import com.google.common.collect.Lists;

import java.util.ArrayList;

public class ToolTest {
    public static void main(String[] args) {
        String str = "a,,b,    c,,,,2312312342,dasdaaa ,德玛西亚,    艾欧尼亚,寒冰之地   ,abCDefGHdasIJklmnoPpQqZz,ooAAdas";
        Iterable<String> split = Splitter.on(",").trimResults().omitEmptyStrings().split(str);
        printResult(split);

    }
    private static void printResult(Iterable<String> split){
        ArrayList<String> result = Lists.newArrayList(split);
        System.out.println("结果集大小："+result.size());
        System.out.println(">>>>输入结果集：");
        for (String s : result) {
            System.out.println(s);
        }
        System.out.println();
    }
}
